<?php

/* @var $this yii\web\View */

\backend\assets\EChartsAsset::register($this);

$this->title = Yii::t('app', 'HR Backend Admin System');
?>
<div class="site-index">

    <div class="row">
        <div class="col-md-6 col-sm-6 col-xs-12">
            <div id="main" class="info-box" style="height: 400px">
                <!-- /.info-box-content -->
            </div>
            <!-- /.info-box -->
        </div>
    </div>

<script>
    <?php $this->beginBlock('js_running')?>

    $(document).ready(function() {
        // 基于准备好的dom，初始化echarts实例
        var myChart = echarts.init(document.getElementById('main'));

        // 指定图表的配置项和数据
        var option = {
            title: {
                text: '员工学历分布'
            },
            tooltip: {},
            legend: {
                data:['学历']
            },
            xAxis: {
                data: ["专科及以下","本科","研究生","博士及以上"]
            },
            yAxis: {},
            series: [{
                name: '学历',
                type: 'bar',
                data: [1000, 15000, 3000, 500]
            }]
        };

        // 使用刚指定的配置项和数据显示图表。
        myChart.setOption(option);
    });
    <?php $this->endBlock()?>
</script>
<?php
$this->registerJs($this->blocks['js_running'], \yii\web\View::POS_END)
?>
